package com.offcn.webui.service;

import com.offcn.dycommon.response.AppResponse;
import com.offcn.webui.config.FeignConfig;
import com.offcn.webui.service.impl.UserServiceFeignException;
import com.offcn.webui.vo.resp.UserAddressVo;
import com.offcn.webui.vo.resp.UserRespVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @Auther: yao
 * @Date: 2020/10/28 10:02
 * @Description:  用户服务调用接口
 */
@FeignClient(value = "SCWUSER",configuration = FeignConfig.class, fallback = UserServiceFeignException.class)
public interface UserServiceFeign {

    @GetMapping("/user/login")   //注意： 两个以上的参数的时候 并且不是占位符方式的传值  参数前面需要加上@RequestParam
    public AppResponse<UserRespVo> login(@RequestParam("username") String username, @RequestParam("password") String password);


    @GetMapping("/user/findMemberById/{id}")
    public AppResponse<UserRespVo> findMemberById(@PathVariable(name = "id") Integer id);

    @GetMapping("/user/findAddressList")
    public AppResponse<List<UserAddressVo>> findAddressList(@RequestParam("accessToken") String accessToken);

}
